﻿<?php

function connectSQL(){
	$user = "root";
	$pass = "";
	$serv = "localhost";
	$dbname = "arrangement";
	$conn = mysql_connect($serv,$user,$pass);
	mysql_select_db($dbname, $conn);
	return $conn;
}

function sendQ($Q){
	$conn = connectSQL();
	$res = mysql_query($Q) or die(mysql_error());
	mysql_close($conn);
	return $res;
}

function sendQCheck($Q){
	$conn = connectSQL();
	mysql_query($Q);
	$err = mysql_errno();
	mysql_close($conn);
	$out = 0;
	
	if(!$err){
		$out = 1;
	}
	
	return $out;
}




?>